package cn.tedu.mall.seckill.exception;

import cn.tedu.mall.common.restful.JsonResult;
import cn.tedu.mall.common.restful.ResponseCode;
import cn.tedu.mall.pojo.seckill.dto.SeckillOrderAddDTO;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SeckillFallBack {

    public static JsonResult seckillFallBack(String randCode,
                                             SeckillOrderAddDTO seckillOrderAddDTO,
                                             Throwable e){
        e.printStackTrace();
        log.error("一个请求发生了降级");
        return JsonResult.failed(
                ResponseCode.INTERNAL_SERVER_ERROR,
                e.getMessage()
        );
    }
}
